Skip to content

Conversation

@Agney-gt
Copy link

@Agney-gt Agney-gt commented Dec 29, 2025

This PR introduces explicit, user-declared message priority to the message queue

What changed

1. Explicit message priority (opt-in)

Users can now declare priority directly in the message text using a structured prefix:

[priority: high] {prompt …}
[priority: normal] {prompt …}
[priority: low] {prompt …}
  • Priority is parsed deterministically from the first non-empty text part.
  • The prefix is removed before execution and does not reach the model.
  • Messages without an explicit prefix default to normal.

Priority is stored as metadata on each queued message.


2. Priority-aware queue draining

Queue draining now selects the next message by:

  1. Highest priority
  2. FIFO order within the same priority

3. Correct hold-mode semantics

In hold mode, all messages are now queued, including the first message in an idle session.

This ensures that:

  • priority extraction always runs,
  • queue state is consistent from the first message onward,
  • and hold behaves as an explicit, predictable buffering mode.

immediate mode behavior is unchanged.


Backwards compatibility

  • Default behavior remains unchanged unless hold mode is explicitly enabled.
  • Messages without a priority tag behave exactly as before (normal priority).
  • No changes to /queue command syntax.

Testing

priority-queue-support.1.mp4

Manually tested:

  • hold mode with first message queued
  • Mixed priority messages (high, normal, low)
  • FIFO ordering within same priority
  • Prefix stripping before execution
  • immediate mode unaffected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant